cmake_minimum_required(VERSION 3.10)
project(webserver C)

set(CMAKE_C_STANDARD 11)

# 查找依赖库
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBMICROHTTPD REQUIRED libmicrohttpd)

add_subdirectory(thirdpart)

# 添加可执行文件
add_executable(webserver src/main.c)

# 链接库
target_include_directories(webserver PRIVATE 
    ${LIBMICROHTTPD_INCLUDE_DIRS}
    ${CMAKE_SOURCE_DIR}/thirdpart/cJSON-1.7.15
)
target_link_libraries(webserver PRIVATE 
    ${LIBMICROHTTPD_LIBRARIES}
    cjson
)